<?php
/**
 * author:chentaiyang
 * time:2016/8/20
 */
header("Content-type:text/html;charest=utf-8");
//数据传输
$orderInfo = array(
	'orderid'=>'201612210001',  //订单号
	'fee'=>166,
	'goodName'=>'商品名称',
	'desc'=>'测试的商品详情'
	);
require_once('config.php');
require_once('lib/alipay_submit.class.php');
//请求构建
$url='https://mapi.alipay.com/gateway.do';    

$data=array(
	'service'       => 'create_direct_pay_by_user',
	'partner'       => $alipay_config['partner'],
	'_input_charset'=> 'UTF-8',
	'sign_type'     => 'MD5',
	'sign'          => $alipay_config['key'],
	'notify_url'    => 'notify_url.php',
	'returnn_url'   => 'returnn_url.php',
	'out_trade_no'  => $orderInfo['orderid'],
	'subject'    	=> $orderInfo['goodName'],
	'payment_type'  => 1,
	'total_fee'     => $orderInfo['fee'],
	'seller_id'    => $alipay_config['seller_id'],
	);
//发送请求
$obj = new AlipaySubmit($alipay_config);
$result=$obj->buildRequestForm($data,'get','跳转' );
var_dump('<pre>',$result);